class Person {
  constructor(name, age) {
    this.name = name
    this.age = age
  }
  running() {
    console.log('running');
  }
}

// Student 为子类（派生类）
class Student extends Person {
  constructor(name, age, sno) {
    super(name, age) // 调用父类构造方法(必须使用在 this 前)
    this.sno = sno
  }
  studying() {
    console.log('studying');
  }
  running() { // 重写父类方法
    super.running() // 运行父类 running 方法的逻辑
    console.log('学生running');
  }
}

var stu = new Student('why', 18, 14)
console.log(stu);
stu.running()